import request from '@/utils/request'

// 查询工单列表
export function listEmsWorkorder(query) {
  return request({
    url: '/ems/emsWorkorder/list',
    method: 'get',
    params: query
  })
}

// 我处理的工单
export function myHandleList(query) {
  return request({
    url: '/ems/emsWorkorder/myHandleList',
    method: 'get',
    params: query
  })
}

// 查询工单详细
export function getEmsWorkorder(id) {
  return request({
    url: '/ems/emsWorkorder/' + id,
    method: 'get'
  })
}

// 新增工单
export function addEmsWorkorder(data) {
  return request({
    url: '/ems/emsWorkorder',
    method: 'post',
    data: data
  })
}

// 修改工单
export function handleOrder(data) {
  return request({
    url: '/ems/emsWorkorder/handle',
    method: 'post',
    data: data
  })
}

// 修改工单
export function handleDetail(data) {
  return request({
    url: '/ems/emsWorkorder/handleDetail/'+data.id,
    method: 'get',
  })
}


// 修改工单
export function updateEmsWorkorder(data) {
  return request({
    url: '/ems/emsWorkorder',
    method: 'put',
    data: data
  })
}


// 删除工单
export function delEmsWorkorder(id) {
  return request({
    url: '/ems/emsWorkorder/' + id,
    method: 'delete'
  })
}
